\(\int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx\) [560]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 58 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\frac {B x \sqrt {a+b x^2}}{2 b}+\frac {(2 A b-a B) \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}} \]

[Out]

1/2*(2*A*b-B*a)*arctanh(x*b^(1/2)/(b*x^2+a)^(1/2))/b^(3/2)+1/2*B*x*(b*x^2+a)^(1/2)/b

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {396, 223, 212} \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\frac {(2 A b-a B) \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}}+\frac {B x \sqrt {a+b x^2}}{2 b} \]

[In]

Int[(A + B*x^2)/Sqrt[a + b*x^2],x]

[Out]

(B*x*Sqrt[a + b*x^2])/(2*b) + ((2*A*b - a*B)*ArcTanh[(Sqrt[b]*x)/Sqrt[a + b*x^2]])/(2*b^(3/2))

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {B x \sqrt {a+b x^2}}{2 b}-\frac {(-2 A b+a B) \int \frac {1}{\sqrt {a+b x^2}} \, dx}{2 b} \\ & = \frac {B x \sqrt {a+b x^2}}{2 b}-\frac {(-2 A b+a B) \text {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {x}{\sqrt {a+b x^2}}\right )}{2 b} \\ & = \frac {B x \sqrt {a+b x^2}}{2 b}+\frac {(2 A b-a B) \tanh ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{2 b^{3/2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.12 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\frac {B x \sqrt {a+b x^2}}{2 b}+\frac {(2 A b-a B) \text {arctanh}\left (\frac {\sqrt {b} x}{-\sqrt {a}+\sqrt {a+b x^2}}\right )}{b^{3/2}} \]

[In]

Integrate[(A + B*x^2)/Sqrt[a + b*x^2],x]

[Out]

(B*x*Sqrt[a + b*x^2])/(2*b) + ((2*A*b - a*B)*ArcTanh[(Sqrt[b]*x)/(-Sqrt[a] + Sqrt[a + b*x^2])])/b^(3/2)

Maple [A] (verified)

Time = 2.82 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.83

method result size
risch \(\frac {B x \sqrt {b \,x^{2}+a}}{2 b}+\frac {\left (2 A b -B a \right ) \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\) \(48\)
default \(\frac {A \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{\sqrt {b}}+B \left (\frac {x \sqrt {b \,x^{2}+a}}{2 b}-\frac {a \ln \left (x \sqrt {b}+\sqrt {b \,x^{2}+a}\right )}{2 b^{\frac {3}{2}}}\right )\) \(63\)
pseudoelliptic \(\frac {B x \sqrt {b}\, \sqrt {b \,x^{2}+a}+2 A \,\operatorname {arctanh}\left (\frac {\sqrt {b \,x^{2}+a}}{x \sqrt {b}}\right ) b -B \,\operatorname {arctanh}\left (\frac {\sqrt {b \,x^{2}+a}}{x \sqrt {b}}\right ) a}{2 b^{\frac {3}{2}}}\) \(64\)

[In]

int((B*x^2+A)/(b*x^2+a)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*B*x*(b*x^2+a)^(1/2)/b+1/2*(2*A*b-B*a)/b^(3/2)*ln(x*b^(1/2)+(b*x^2+a)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.90 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\left [\frac {2 \, \sqrt {b x^{2} + a} B b x - {\left (B a - 2 \, A b\right )} \sqrt {b} \log \left (-2 \, b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right )}{4 \, b^{2}}, \frac {\sqrt {b x^{2} + a} B b x + {\left (B a - 2 \, A b\right )} \sqrt {-b} \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right )}{2 \, b^{2}}\right ] \]

[In]

integrate((B*x^2+A)/(b*x^2+a)^(1/2),x, algorithm="fricas")

[Out]

[1/4*(2*sqrt(b*x^2 + a)*B*b*x - (B*a - 2*A*b)*sqrt(b)*log(-2*b*x^2 - 2*sqrt(b*x^2 + a)*sqrt(b)*x - a))/b^2, 1/
2*(sqrt(b*x^2 + a)*B*b*x + (B*a - 2*A*b)*sqrt(-b)*arctan(sqrt(-b)*x/sqrt(b*x^2 + a)))/b^2]

Sympy [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.41 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\begin {cases} \frac {B x \sqrt {a + b x^{2}}}{2 b} + \left (A - \frac {B a}{2 b}\right ) \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {otherwise} \end {cases}\right ) & \text {for}\: b \neq 0 \\\frac {A x + \frac {B x^{3}}{3}}{\sqrt {a}} & \text {otherwise} \end {cases} \]

[In]

integrate((B*x**2+A)/(b*x**2+a)**(1/2),x)

[Out]

Piecewise((B*x*sqrt(a + b*x**2)/(2*b) + (A - B*a/(2*b))*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqr
t(b), Ne(a, 0)), (x*log(x)/sqrt(b*x**2), True)), Ne(b, 0)), ((A*x + B*x**3/3)/sqrt(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.81 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {b x^{2} + a} B x}{2 \, b} - \frac {B a \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{2 \, b^{\frac {3}{2}}} + \frac {A \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {b}} \]

[In]

integrate((B*x^2+A)/(b*x^2+a)^(1/2),x, algorithm="maxima")

[Out]

1/2*sqrt(b*x^2 + a)*B*x/b - 1/2*B*a*arcsinh(b*x/sqrt(a*b))/b^(3/2) + A*arcsinh(b*x/sqrt(a*b))/sqrt(b)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.83 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\frac {\sqrt {b x^{2} + a} B x}{2 \, b} + \frac {{\left (B a - 2 \, A b\right )} \log \left ({\left | -\sqrt {b} x + \sqrt {b x^{2} + a} \right |}\right )}{2 \, b^{\frac {3}{2}}} \]

[In]

integrate((B*x^2+A)/(b*x^2+a)^(1/2),x, algorithm="giac")

[Out]

1/2*sqrt(b*x^2 + a)*B*x/b + 1/2*(B*a - 2*A*b)*log(abs(-sqrt(b)*x + sqrt(b*x^2 + a)))/b^(3/2)

Mupad [B] (verification not implemented)

Time = 5.41 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.48 \[ \int \frac {A+B x^2}{\sqrt {a+b x^2}} \, dx=\left \{\begin {array}{cl} \frac {B\,x^3+3\,A\,x}{3\,\sqrt {a}} & \text {\ if\ \ }b=0\\ \frac {A\,\ln \left (\sqrt {b}\,x+\sqrt {b\,x^2+a}\right )}{\sqrt {b}}-\frac {B\,a\,\ln \left (2\,\sqrt {b}\,x+2\,\sqrt {b\,x^2+a}\right )}{2\,b^{3/2}}+\frac {B\,x\,\sqrt {b\,x^2+a}}{2\,b} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

[In]

int((A + B*x^2)/(a + b*x^2)^(1/2),x)

[Out]

piecewise(b == 0, (3*A*x + B*x^3)/(3*a^(1/2)), b ~= 0, (A*log(b^(1/2)*x + (a + b*x^2)^(1/2)))/b^(1/2) - (B*a*l
og(2*b^(1/2)*x + 2*(a + b*x^2)^(1/2)))/(2*b^(3/2)) + (B*x*(a + b*x^2)^(1/2))/(2*b))